home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 11425 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Borland C's tmpnam()
  5. Date: Sun, 24 Mar 96 00:19:50 GMT
  6. Organization: none
  7. Message-ID: <827626790snz@genesis.demon.co.uk>
  8. References: <AD75E5DC9668E2A52@mcdiala13.it.luc.edu> <Pine.A32.3.91.960322134158.23347A-100000@red.weeg.uiowa.edu> <AD78E5E796681EC58@mcdialb10.it.luc.edu>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <AD78E5E796681EC58@mcdialb10.it.luc.edu>
  15.            VArase@varase.it.luc.edu "Verne Arase" writes:
  16.  
  17. >In article <Pine.A32.3.91.960322134158.23347A-100000@red.weeg.uiowa.edu>,
  18. >The Amorphous Mass <robinson@blue.weeg.uiowa.edu> wrote:
  19. >
  20. > >> The online documentation (all I have) says that it returns a file name
  21. > >> "which can be safely used as the name of a temporary file".
  22. > >> 
  23. > >> What does this mean?
  24. > >
  25. > >  It means that it generates a filename that is guaranteed to be unique 
  26. > >-- ie it won't overwrite an existing file.
  27. >
  28. >Another EMail response I got suggests otherwise. The fact that they didn't
  29. >provide a path parameter also suggests that they weren't terribly serious.
  30.  
  31. The implementation decides where to put it, whether in the current directory
  32. or not.
  33.  
  34. >The other response I mentioned said that (_my synopsis_) all it guaranteed
  35. >was that the provided file name is compatible with your file system.
  36.  
  37. That is wrong. The standard says (7.9.9.4)
  38.  
  39. "The tempnam function generates a string that is a valid file name and that
  40.  is not the name of an existing file."
  41.  
  42. >If it did more I'd expect that to be documented and flagged as a Borland
  43. >non-portable extension.
  44.  
  45. It is standard.
  46.  
  47. >It seems to be a good start for a serious tempname(), however :-).
  48.  
  49. The C language standard has no concept of a directory so, unless I
  50. misunderstand you, I can't see what this would do differently from
  51. tmpnam().
  52.  
  53. -- 
  54. -----------------------------------------
  55. Lawrence Kirby | fred@genesis.demon.co.uk
  56. Wilts, England | 70734.126@compuserve.com
  57. -----------------------------------------
  58.